package com.lhl.fw.db.biz.domain.entity;

import com.lhl.fw.db.entity.BaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;

@Entity
@Getter
@Setter
@NoArgsConstructor
@Inheritance(strategy=InheritanceType.JOINED)//每个类一张表
//@Inheritance(strategy=InheritanceType.SINGLE_TABLE)//所有类一张表映射
//@DiscriminatorColumn(name="Discriminator",discriminatorType=DiscriminatorType.STRING,length=30)//区别字段是Discriminator，类型是String
public class Employee extends BaseEntity<String> {

	private String name;
	@ManyToOne(optional=false,cascade=CascadeType.PERSIST,fetch=FetchType.LAZY)
	@JoinColumn(name="c_id")
	private Company company;
}
